Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Geometric Shapes Reference
Functions / Getting and Setting Shape Geometries


GXGetPolygons

You can use the GXGetPolygons function to determine the geometry of a polygon shape.

long GXGetPolygons(gxShape source, gxPolygons *data);
source
A reference to the polygon shape whose geometry you want to determine.
data
A pointer to a gxPolygons data structure. The function copies the source shape's geometry into this structure.
function result
The length in bytes of the source shape's geometry.
DESCRIPTION
The GXGetPolygons function copies the geometry information from the source polygon shape into the gxPolygons structure pointed to by the data parameter. As the function result, this function returns the length in bytes of the polygon geometry.

If the source shape is not a polygon shape, this function posts the error code illegal_type_for_shape.

You may pass nil for the data parameter. In this case, the GXGetPolygons function still returns the length of the data as the function result, but it does not return the actual data in the data parameter.

Typically, to use this function, you go through the following steps:

  1. Determine the length of the polygon data by calling this function, passing nil for the data parameter.
  2. Allocate enough memory to hold the polygon data.
  3. Call this function again, passing a pointer to the allocated memory in the data parameter.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
illegal_type_for_shape(debugging version)
SEE ALSO
For general information about polygon geometries, see "Polygon Shapes" on page 2-22.

For the definition of the gxPolygons structure, see page 2-106.

To create a new polygons shape, use the GXNewPolygons function, which is described on page 2-116.

To change the geometry of an existing polygon shape, use the GXSetPolygons function, which is described in the next section.

To draw a polygon geometry without creating a polygon shape, use the GXDrawPolygons function, which is described on page 2-161. To draw a polygons shape, use the GXDrawShape function, which is described in the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help